package com.gitee.neuray.security.generator.enums;

import java.util.Objects;

/**
 * @author: zhhongyu
 * @description: 生成方式类型
 * @since: Create in 14:58 2020/2/14
 */
public enum GenerationTypeEnum {
    one("one","one"),
    multi("some","some"),
    OTHER("other","other");
    private String name;
    private String value;
    GenerationTypeEnum(String name, String value){
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static GenerationTypeEnum getEnum(String type){
        GenerationTypeEnum[] values = GenerationTypeEnum.values();
        for (GenerationTypeEnum typeEnum:
             values) {
            if(Objects.equals(type,typeEnum.getValue())){
                return typeEnum;
            }
        }
        return null;
    }
}
